<template>
	<view>
		<view class="my-content">
			<view class="my-content-list">
				<template>
					<view class="all">
						<view class="content-left">
							<view class="letf-name">
								头像
							</view>
						</view>
						<view class="content-right" @click="goEditPersonal ">
							<view class="right-img">
								<image class="img"
									:src="userInfo.provider === 'tel'? `https://zyc618.mynatapp.cc/${userInfo.imgUrl}` : `${userInfo.imgUrl}`">
								</image>
							</view>
						</view>
					</view>
					<mylines></mylines>
				</template>
				<view class="" @tap="gopathlist()">
					<view class="my-content-item" >
						<view class="content">
							<view class="text">
								名字
							</view>
						</view>
						<view class="">
							{{userdetail.nickName}}
						</view>
					</view>
					<mylines></mylines>
					<view class="my-content-item" >
						<view class="content">
							<view class="text">
								性别
							</view>
						</view>
						<view class="">
							{{userdetail.sex}}
						</view>
					</view>
					<mylines></mylines>
					<view class="my-content-item" >
						<view class="content">
							<view class="text">
								地区
							</view>
						</view>
						<view class="">
							{{userdetail.arce}}
						</view>
					</view>
					<mylines></mylines>
					<view class="my-content-item" >
						<view class="content">
							<view class="text">
								微信
							</view>
						</view>
						<view class="">
							{{userdetail.WeChat}}
						</view>
					</view>
					<mylines></mylines>
					<view class="my-content-item" >
						<view class="content">
							<view class="text">
								手机号
							</view>
						</view>
						<view class="">
							{{userdetail.phone}}
						</view>
					</view>
					<mylines></mylines>
					<view class="my-content-item" >
						<view class="content">
							<view class="text">
								QQ
							</view>
						</view>
						<view class="">
							{{userdetail.QQ}}
						</view>
					</view>
					<mylines></mylines>
					<view class="my-content-item" >
						<view class="content">
							<view class="text">
								生日
							</view>
						</view>
						<view class="">
							{{userdetail.birthday}}
						</view>
					</view>
					<mylines></mylines>
					<view class="my-content-item" >
						<view class="content">
							<view class="text">
								邮箱
							</view>
						</view>
						<view class="">
							{{userdetail.email}}
						</view>
					</view>
					<mylines></mylines>
					<view class="my-content-item"  @click="goeditsignature">
						<view class="content">
							<view class="text">
								个性签名
							</view>
						</view>
						<view class="">
							{{userdetail.signature}}
						</view>
					</view>
					<mylines></mylines>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import mylines from '@/components/common/Lines.vue'
	import $http from '@/common/api/request.js'
	import {
		mapMutations,
		mapState
	} from 'vuex'
	export default {
		data() {
			return {
				userid:0,
				userdetail:{},
				
			};
		},
		components: {
			mylines
		},
		onLoad(e) {
			this.userid = e.id;
			//发起请求获取数据:
			this.getuserdetail()
		},
		computed: {
			...mapState({
				loginStatus: state => state.user.loginStatus,
				userInfo: state => state.user.userInfo
			})
		},
		methods: {
			//修改个性签名:
			goeditsignature(){
				uni.navigateTo({
					url:`/pages/editsignature/editsignature?id=${this.userid}`
				})
			},
			//发起请求获取用户:
			getuserdetail(){
				$http.request({
					url: "/getbackparentdetail",
					method:"POST",
					data:{
						id:this.userid
					}
				}).then((res) => {
					uni.showToast({
						title: "获取数据中...",
						icon: "none",
						mask: true,
						duration: 200,
						success: () => {
							this.userdetail = res[0]
						}
					})
				}).catch(() => {
				})
			},
			//点击个人资料函数:
			goEditPersonal(){
				uni.navigateTo({
					url:`/pages/editpersonal/editpersonal`
				})
			},
			gopathlist(index) {
				
			},
		},
		onShow() {
			this.getuserdetail()
		}
	}
</script>

<style lang="scss">
	.my-content {
		.toptop {
			padding: 20rpx;

		}

		.my-content-list {
			.my-content-item {
				display: flex;
				justify-content: space-between;
				padding: 0 10rpx;
				margin: 20rpx 0;

				.content {
					display: flex;

					.imgall {
						padding: 10rpx;

						.img {
							width: 40rpx;
							height: 40rpx;
						}

						margin-right: 15rpx;
					}

					.text {
						font-size: 32rpx;
						line-height: 56rpx;
					}
				}

				.imgs {
					padding: 10rpx;

					.img {
						width: 30rpx;
						height: 30rpx;
					}

				}


			}

			.all {
				display: flex;
				justify-content: space-between;
				align-items: center;

				.content-left {
					padding: 5rpx;
					display: flex;
					align-items: center;

					

					.letf-name {

						
					}
				}

				.content-right {
					
					display: flex;

					.right-name {
						color: #d7d7d7;
					}

					.right-img {
						padding: 5rpx;
						.img {
							width: 130rpx;
							height: 130rpx;
						}
					}
				}
			}

		}
	}

	.content-button {
		background-color: #00a8df;
		width: 100%;
		padding: 30rpx;
		font-weight: 800;
		text-align: center;
	}
</style>